package com.ll.blog.repository;


import com.ll.blog.entity.Article;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface ArticleRepository extends JpaRepository<Article, Integer> {

    @Query(value = "SELECT * from t_article ORDER BY t_article.created DESC limit ?1,?2", nativeQuery = true)
    List<Article> findAllByPage(Integer pageNum, Integer pageSize);

}
